#ifndef SERIALPORTTHREAD_H
#define SERIALPORTTHREAD_H

#include <QThread>
#include <QtSerialPort/QtSerialPort>

class SerialPortThread : public QThread
{
    Q_OBJECT
public:
    SerialPortThread(QString serialNum, int baudRate, QString parity, int dataBit, QString stopBit);
    QSerialPort *serialConnector;
    bool isReady = false;
    int connectSerial();
    void disconnectSerial();
    void sendSerial(QString cmd);
    char* recv(int size);
    ~SerialPortThread();
private:
    QString serialNum, parity;
    int baudRate;
    int dataBit;
    QString stopBit;


};

#endif // SERIALPORTTHREAD_H
